package com.jeff.android.lab.architecture.arouter.server;

import com.alibaba.android.arouter.facade.annotation.Autowired;
import com.alibaba.android.arouter.launcher.ARouter;

/**
 * @author: dingfeng
 * @date: 2021/1/22
 * @since: 1.0.0
 **/
public class CarRentalServiceManager {

//    @Autowired
//    public CarRentalService carRentalService;

//    @Autowired(name = "/service/car")
//    public CarRentalService carRentalService;

    public CarRentalService carRentalService;

    private static CarRentalServiceManager sInstance;

    public static CarRentalServiceManager get() {
        if (null == sInstance)
            sInstance = new CarRentalServiceManager();
        return sInstance;
    }

    private CarRentalServiceManager() {
//        ARouter.getInstance().inject(this);

//        carRentalService = ARouter.getInstance().navigation(CarRentalService.class);
        carRentalService = (CarRentalService) ARouter.getInstance().build("/service/car").navigation();
    }

    public void pickUp() {
        carRentalService.pickUp();
    }

    public void giveBack() {
        carRentalService.giveBack();
    }

}
